//
//  XDMyInvestmentModel.m
//  xindailianmeng
//
//  Created by 张东 on 2017/2/9.
//  Copyright © 2017年 xindailianmeng.cn. All rights reserved.
//

#import "XDMyInvestmentModel.h"
#import "MJExtension.h"
@implementation XDMyInvestmentModel
- (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property
{
    if ([property.name isEqualToString:@"inTime"] || [property.name isEqualToString:@"payTime"] || [property.name isEqualToString:@"payBackTime"] || [property.name isEqualToString:@"nearBackTime"] ) {
//        2017-01-09 14:17:27
        NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
        fmt.dateFormat = @"yyyy-MM-dd HH:mm:ss";
        NSDate *date = [fmt dateFromString:oldValue];
        
        NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
        dateFormatter.dateFormat = @"yyyy-MM-dd";
        NSString *strDate = [dateFormatter stringFromDate:date];
        return strDate;
    }
    return oldValue;
}
@end
